<include file="Public:header"/>
<script type="text/javascript">
$(document).ready(function(){
	$('select[name="bill_type"]').val('{$bill_type}');
	$('select[name="user_type"]').val('{$user_type}');
	$('select[name="account_type"]').val('{$account_type}');
	$('select[name="bank_type"]').val('{$bank_type}');
	$('select[name="pay_type"]').val('{$pay_type}');
	$('select[name="time_type"]').val('{$time_type}');
	$('select[name="kw_type"]').val('{$kw_type}');
	if($('select[name="time_type"]').val() == 'custom'){
		$('.custom_time').show();
	}
	$('select[name="time_type"]').change(function () {
		time_type = $(this).val();
		if(time_type == 'custom'){
			$('.custom_time').show();
		}else{
			$('.custom_time').hide();
		}
	});

	//查询钱是否到账
	$('.query-status').click(function () {
		var take_out_id = $(this).attr('take-out-id');
		var url  = '{:U("take_out_status_query")}';
		var data = "take_out_id=" + take_out_id;

		loading('正在查询，请稍候...');
		$.ajax({
			url : url,
			data : data,
			type : 'get',
			dataType:'json',
			success : function(json){
				removeLoading();
				if(json.status == 200){
					msgbox(json.info);
					
					$('.take-out-' + take_out_id).find('.status_desc').text('提现成功');
					var opt_html = '<a href="{:U('win_take_out')}?id=' + take_out_id + '" class="win btn1">查看</a>';
					$('.take-out-' + take_out_id).find('.opt-info').html(opt_html);
				}else{
					msgbox(json.info,'error');
				}
			}
		});
	})
});
</script>
<style type="text/css">
.condition div{
	margin: 5px 0px;
}
</style>

<div class="form_data">
	<form action="" method="get" filterValid="true">
	<div class="mod_data">
		<table width="100%" class="condition">
			<tr class="filter">
				<td width="40%" valign="top">
					<eq name="_city_id" value="">
					<div>
						<span class="name">区域：</span>
						{:W('Plugin/area_select', array('', 0, 0))}
					</div>
					</eq>

					<div>
						<span class="name">提现时间：</span>
						<select name="time_type">
							<option value="">全部</option>
							<option value="today">今天</option>
							<option value="week">一周</option>
							<option value="month">一个月</option>
							<option value="3month">三个月</option>
							<option value="custom">自定义</option>
						</select>
						<span style="display: none" class="custom_time">
							<input type="text" name="start_date" id="start_date" value="{$start_date}" onclick="WdatePicker({maxDate:'#F{$dp.$D(\\'end_date\\')}'})" style="width:80px;">
							至
							<input type="text" name="end_date" id="end_date" value="{$end_date}" onclick="WdatePicker({minDate:'#F{$dp.$D(\\'start_date\\')}'})" style="width:80px;">
						</span>
					</div>

					<div>
						<span class="name">审核时间：</span>
						<span>
							<input type="text" name="audit_start_date" id="audit_start_date" value="{$audit_start_date}" onclick="WdatePicker({maxDate:'#F{$dp.$D(\\'end_date\\')}'})" style="width:80px;">
							至
							<input type="text" name="audit_end_date" id="audit_end_date" value="{$audit_end_date}" onclick="WdatePicker({minDate:'#F{$dp.$D(\\'audit_start_date\\')}'})" style="width:80px;">
						</span>
					</div>

					<div>
						<span class="name">关键字：</span>
						<select name="kw_type">
							<option value="user_id">用户ID</option>
							<option value="mobile">手机号</option>
							<option value="realname">姓名</option>
						</select>
						<input type="text" name="k_word" value="{$k_word}" style="width:130px;"/>
					</div>
					<div>
						<span class="name">金额范围：</span>
						<input type="text" name="start_price" value="{$start_price}" style="width:80px;">
						-
						<input type="text" name="end_price" value="{$end_price}" style="width:80px;">
					</div>
				</td>
				<td valign="top">
					<div>
						<span class="name">提现到：</span>
						<select name="bank_type">
							<option value="">全部</option>
							<option value="1">银行</option>
							<option value="2">支付宝</option>
						</select>
					</div>

					<div>
						<span class="name">平台提现银行：</span>
						<select name="platform_bank_id">
							<option value="">全部</option>
							<php>$platform_bank_list = D('Category')->get_list('platform_bank_list');</php>
							<volist name="platform_bank_list" id="rs">
							<option value="{$rs['id']}" <eq name="rs.id" value="$platform_bank_id">selected</eq>>{$rs['title']}({$rs['description']})</option>
							</volist>
						</select>
					</div>

					<div>
						<span class="name">审核状态：</span>
						<select name="status">
							<option value="">全部</option>
							<php>$take_out_status_desc = C('take_out_status_desc');</php>
							<volist name="take_out_status_desc" id="status_name">
							<option value="{$key}" <eq name="status" value="$key">selected</eq>>{$status_name}</option>
							</volist>
						</select>
					</div>

					<div>
						<span class="name">终端来源：</span>
						<label><input type="checkbox" class="checkbox" name="app_type[]" value="android" <eq name="app_is_android" value="true">checked</eq>>android</label>
						<label><input type="checkbox" class="checkbox" name="app_type[]" value="ios" <eq name="app_is_ios" value="true">checked</eq>>ios</label>
						<label><input type="checkbox" class="checkbox" name="app_type[]" value="web" <eq name="app_is_web" value="true">checked</eq>>web</label>
						<label><input type="checkbox" class="checkbox" name="app_type[]" value="wap" <eq name="app_is_wap" value="true">checked</eq>>wap</label>
						<label><input type="checkbox" class="checkbox" name="app_type[]" value="system" <eq name="app_is_system" value="true">checked</eq>>system</label>
					</div>
					
				</td>
			</tr>
		</table>
		
	</div>
	<div class="mod_data">
		<input type="submit" value="搜索" class="btn1" style="width:auto;height:auto;padding:3px 15px;">
	</div>
	</form>
</div>
<eq name="INVESTOR_SHOW" value="0">
<div class="total">
	<eq name="_is_supper_admin" value="true">
	金额汇总:<span class="price">{$total_price}</span>，
	</eq>
	本页汇总：<span class="price">{$page_price}</span>
</div>
</eq>
<div class="data_list">
	<table style="<neq name='table_width' value=''>width:{$table_width}px;</neq>">
		<tr>
			<volist name="data_title" id="rs">
				<neq name="rs.no_show" value="true">
				<th>{$rs['title']}</th>
				</neq>
			</volist>
			<th width="120">操作</th>
		</tr>
		<volist name="list" id="rs">
		<tr class="take-out-{$rs['id']}">
			<volist name="data_title" id="val">
				<neq name="val.no_show" value="true">
				<td <neq name="val.td_style" value="">style="{$val['td_style']}"</neq>>
				<span class="<neq name="val.val_class" value="">{$val['val_class']}</neq>">
					<php> if($rs[$key]){ </php>
						{$val['val_pre']}{$rs[$key]}
					<php> }else{ </php>
						{$val['val_pre']}{$val['val_default']}
					<php> } </php>
				</span>
				</td>
				</neq>
			</volist>
			<td class="opt-info">
				<eq name="rs.status" value="1">
					<a href="{:U('win_take_out',array('id'=>$rs['id'], 'page'=>$p))}" class="win btn2">提现</a>
				<else/>
					<eq name="rs.status" value="4">
						<a class="btn2 query-status" take-out-id="{$rs['id']}">进度查询</a>
					<else/>
						<a href="{:U('win_take_out',array('id'=>$rs['id']))}" class="win btn1">查看</a>
					</eq>
				</eq>
			</td>
		</tr>
		</volist>
	</table>
</div>
<div class="page">{$page}</div>
<include file="Public:footer"/>